home *** CD-ROM | disk | FTP | other *** search
/ Dream 55 / Amiga_Dream_55.iso / RISCOS / APPS / TEXT / PS / KIT-PS.ZIP / Kit PS / !PSUtils / pl / fixwfwps < prev    next >
Text File  |  1997-01-24  |  892b  |  41 lines

  1. @rem = '-*- Perl -*-
  2. @echo off
  3. perl -S %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9
  4. goto endofperl
  5. ';
  6.  
  7. # fixwfwps: fix Word for windows PostScript for printing.
  8. #
  9. # Copyright (C) Angus J. C. Duggan 1991-1995
  10. # See file LICENSE for details.
  11.  
  12. $nesting = 0;
  13. while (<>) {
  14.    tr/\000-\010\012-\014\016-\037//d;
  15.    foreach (grep($_ ne "", split("\015"))) {
  16.       s!/SVDoc\s+save\s+def!!g;
  17.       s!SVDoc\s+restore!!g;
  18.       if (/^(%!PS-Adobe-\d*\.\d*) EPSF-/ && !$nesting) {
  19.      print "$1\n";
  20.      $wfwepsf = 1;
  21.       } elsif (/^SS\s*$/ && $wfwepsf) {
  22.      print "%%Page: $wfwepsf $wfwepsf\n";
  23.      $wfwepsf++;
  24.      print "$_\n";
  25.       } elsif (/^%MSEPS Preamble/) {
  26.      print "%%BeginDocument: (Included EPSF)\n";
  27.      print "$_\n";
  28.      $nesting++;
  29.       } elsif (/^%MSEPS Trailer/) {
  30.      $nesting--;
  31.      print "$_\n";
  32.      print "%%EndDocument\n";
  33.       } elsif (! /^%%BoundingBox/) {
  34.      print "$_\n";
  35.       }
  36.    }
  37. }
  38. __END__
  39. :endofperl
  40.  
  41.